<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath()}+'/'">
	<meta charset="UTF-8">
	<title>个人信息</title>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap-theme.css">
    <style type="text/css"></style>
    <script type="text/javascript">
        function checkall() {
            var ordersIdALL = document.getElementById("ordersIdALL");
            var orderIds = document.getElementsByName("orderIds");
            for (var i = 0; i < orderIds.length; i++) {
                orderIds[i].checked = ordersIdALL.checked;
            }
        }

        function todel(account,id) {
            if (confirm("是否确认删除?")) {
                location.href = "order/delAll?orderId=" + id+"&userAccount="+account;
            }
        }
        function toUpdateBad(account,id) {
            if (confirm("是否确认删除?")) {
                location.href = "order/UpdateBad?orderId=" + id+"&userAccount="+account;
            }
        }
        function toUpdateOK(account,id) {
            if (confirm("是否确认删除?")) {
                location.href = "order/UpdateOK?orderId=" + id+"&userAccount="+account;
            }
        }
    </script>
</head>
<body>
	<div class="container">
        <div class="row" style="height: 80px;width: 100%;
        text-align: center;line-height: 80px;background-color: #f2f2f2;"> <h1>个人中心</h1></div>
        <div class="row">
        	<div class="col-md-3" style="height: 200px;"><img src="../image/user2-160x160.jpg"></div>
            <div class="col-md-9" style="height: 200px;">
                <form action="user/updateUser" method="post">
                    <table style="border-collapse:separate; border-spacing:0px 10px;">
                        <tr>
                            <td >昵称：</td>
                            <td>
                                <input type="text" th:value="${userUp.userName}" placeholder="限制字符5个" maxlength="5" name="userName" required></input>
                                <input type="hidden" name="userAccount"></input>
                            </td>
                        </tr>
                        <tr>
                            <td >密码：</td>
                            <td><input type="text" th:value="${userUp.userPassword}" placeholder="不超过20个字符" maxlength="20" name="userPassword" required></input></td>
                        </tr>
                        <tr>
                            <td>收货地址：</td>
                            <td><input type="text" th:value="${userUp.userAddress}" placeholder="便于收货" name="userAddress" required></input></td>
                        </tr>
                        <tr>
                            <td>邮箱：</td>
                            <td><input type="email" th:value="${userUp.userMail}" name="userMail" required></input></td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center;">
                                <input type="submit" value="修改个人信息提交"></input>
                            </td>
                          
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="row" style="height: 80px;"><h2>购物清单</h2><hr></div>

    	<div class="row">
    		<table class="table">
    			<tr>
                    <th><input type="checkbox" name="ordersIdALL" id="ordersIdALL" onclick="checkall()">
                    全选</th>    
    				<th>单号</th>
    				<th>总价</th>
    				<th>状态0:未支付1已支付2待发货3已完结4退货退款</th>
    				<th>操作</th>
    			</tr>
                <tr th:each="order:${orders}">
                    <td><input type="checkbox"  name="orderIds" th:value="${order.order_userAccount}"></input></td>
                    <td th:text="${order.orderId}">12135454</td>
                    <td th:text="${order.orderAllMoney}">2211</td>
                    <td th:text="${order.orderStatus}">2</td>
                    <td>
                        <a href="javascript:;" th:onclick="todel([[${order.order_userAccount}]],[[${order.orderId}]])">删除</a>
                        <a href="javascript:;" th:onclick="toUpdateOK([[${order.order_userAccount}]],[[${order.orderId}]])">确认收货</a>
                        <a href="javascript:;" th:onclick="toUpdateBad([[${order.order_userAccount}]],[[${order.orderId}]])">退单</a>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td><a href="order/orderAll">清空</a></td>
                    <td></td>
                    <td></td>
                </tr>
    		</table>

    	</div>
</body>
</html>